﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace LastFmDemo
{
    public partial class ArtistDetail : UserControl
    {
        String _Plays;

        public String Plays
        {
            get { return _Plays; }
            set
            {
                _Plays = value;
                lbPlays.Text = value;
            }
        }
        String _Artist;

        public String Artist
        {
            get { return _Artist; }
            set
            {
                _Artist = value;
                lbArtist.Text = value;
            }
        }
        String _ImageURL;

        public String ImageURL
        {
            get { return _ImageURL; }
            set
            {
                _ImageURL = value;
                Thread thread = new Thread(new ThreadStart(LoadImageThread));
                thread.Start();
            }
        }
        String _Bio;

        public String Bio
        {
            get { return _Bio; }
            set
            {
                _Bio = value;
                tbBio.Text = value;
            }
        }
        public ArtistDetail()
        {
            InitializeComponent();
        }
        public void LoadImageThread()
        {
            pbImage.Load(_ImageURL);            
        }
        public ArtistDetail(String artist, String plays, String imageURL)
        {
            InitializeComponent();
            Artist = artist;
            Plays = plays;
            ImageURL = imageURL;
        }
    }
}
